package com.study.designmodel.abstractfactory;

import com.study.designmodel.factory.Shape;

/**
 * @description: ShapeFactory
 * @date: 2021/2/4 0:26
 * @author: hcm
 * @version: 1.0
 */
public class ColorFactory extends AbstractFactory{

    @Override
    public Color getColor(String color) {
        if(color == null){
            return null;
        }
        if(color.equalsIgnoreCase("r")){
            return new Red();
        }else if(color.equalsIgnoreCase("y")){
            return new yellow();
        }else if(color.equalsIgnoreCase("g")){
            return new Green();
        }
        return null;
    }

    @Override
    public Shape getShape(String shape) {
        return null;
    }
}
